package com.zhanghp.common;

import java.util.Arrays;

/**
 * @author zhanghp
 * @since 2024/2/21 10:49
 */
public class PrintUtil {

    public static void printArr(int[] arr) {
        System.out.println(Arrays.toString(arr));
    }

    public static void printListNode(ListNode node) {
        System.out.print("[");
        while (node != null) {
            System.out.print(node.val + (node.next == null ? "" : ","));
            node = node.next;
        }
        System.out.println("]");
    }

    public static void printListNode(DoubleListNode doubleListNode) {
        System.out.print("DoubleListNode: [");
        while (doubleListNode != null) {
            System.out.println(doubleListNode.val + (doubleListNode.next==null ?"" : ","));
            doubleListNode = doubleListNode.next;
        }
        System.out.println("]");
    }


}
